package com.missilike.admin.controller;

import com.missilike.biz.IMilAccountService;
import com.missilike.core.result.CommonResult;
import com.missilike.core.utils.ResultUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/dashboard")
public class DashBoardController {

    private final IMilAccountService milAccountService;

    @Autowired
    public DashBoardController(IMilAccountService milAccountService) {
        this.milAccountService = milAccountService;
    }

    @RequestMapping(value = "top_user", method = RequestMethod.GET)
    public CommonResult topUser() {
        return ResultUtils.ok(milAccountService.getTopUser());
    }
}
